import { PageContainer, ProFormRadio, ProForm } from '@ant-design/pro-components';
import { Form, message } from 'antd';
import { Card } from 'antd';
interface FormType {
  infoConfig: string;
}
const Index: React.FC = () => {
  const [formRef] = Form.useForm<FormType>();
  return (
    <div>
      <PageContainer title="个人资料">
        <Card>
          <ProForm
            title="私信设置"
            form={formRef}
            submitter={false}
            initialValues={{
              infoConfig: 'a',
            }}
            onFinish={async (values) => {
              console.log(values);
              message.success('提交成功');
              return true;
            }}
          >
            <ProFormRadio.Group
              name="infoConfig"
              label="允许谁给我发私信"
              options={[
                {
                  label: '所有人',
                  value: 'a',
                },
                {
                  label: '我关注的人',
                  value: 'b',
                },
                {
                  label: '互相关注的人',
                  value: 'c',
                },
                {
                  label: '关闭(不允许任何人给我发私信)',
                  value: 'd',
                },
              ]}
            />
          </ProForm>
        </Card>
      </PageContainer>
    </div>
  );
};
export default Index;
